{
    // 接口中只能写规范
    interface AnimationInterface{
        name: string
        move():void
    }

    abstract class Animations{
        protected getPos():{x:number;y:number}{
            return {x:100,y:300}
        }
    }

    class Tank extends Animations implements AnimationInterface{
        name:string = "敌方坦克"
        move():void{
            console.log(`${this.name}正在移动`)
        }
    }

    // 既继承了抽象类，也被接口所约束
    class Player extends Animations implements AnimationInterface{
        name:string = "玩家"
        move():void{
            console.log(`${this.name}坦克正在移动`)
        }
    }

    const tank = new Tank();
    tank.move();

    const player = new Player();
    player.move();
}